﻿using System;
namespace Microsoft.Data.OData
{
    /// <summary>
    /// Enumeration of all possible states of an <see cref="T:Microsoft.Data.OData.ODataCollectionReader" />.
    /// </summary>
    public enum ODataCollectionReaderState
    {
        /// <summary>The reader is at the start; nothing has been read yet.</summary>
        /// <remarks>In this state, the Item property of the <see cref="T:Microsoft.Data.OData.ODataCollectionReader" /> returns null.</remarks>
        Start,
        /// <summary>
        /// The reader has started reading and is reading the start element of the collection wrapper (if any).
        /// No items have been read.
        /// </summary>
        /// <remarks>
        /// In this state, the Item property of the <see cref="T:Microsoft.Data.OData.ODataCollectionReader" /> returns 
        /// an instance of <see cref="T:Microsoft.Data.OData.ODataCollectionStart" />.
        /// </remarks>
        CollectionStart,
        /// <summary>
        /// The reader read an item from the collection.
        /// </summary>
        /// <remarks>In this state, the Item property of the <see cref="T:Microsoft.Data.OData.ODataCollectionReader" /> returns the read item (a primitive value, an ODataComplexValue or null).</remarks>
        Value,
        /// <summary>
        /// The reader has finished reading and is reading the end element of the collection wrapper (if any).
        /// All items have been read.
        /// </summary>
        /// <remarks>
        /// In this state, the Item property of the <see cref="T:Microsoft.Data.OData.ODataCollectionReader" /> returns the same
        /// instance of <see cref="T:Microsoft.Data.OData.ODataCollectionStart" /> as in state CollectionStart.
        /// </remarks>
        CollectionEnd,
        /// <summary>The reader has thrown an exception; nothing can be read from the reader anymore.</summary>
        /// <remarks>
        /// In this state, the Item property of the <see cref="T:Microsoft.Data.OData.ODataCollectionReader" /> returns null.
        /// </remarks>
        Exception,
        /// <summary>The reader has completed; nothing can be read anymore.</summary>
        /// <remarks>
        /// In this state, the Item property of the <see cref="T:Microsoft.Data.OData.ODataCollectionReader" /> returns null.
        /// </remarks>
        Completed
    }
}
